package cloud.xlh.agent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.URL;
import java.net.URLClassLoader;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : example
 * @ Author: XuLeHuang
 * @ Date: 2022/10/3 10:56
 * @ Description:
 */
public class DynamicClassLoader extends URLClassLoader {
    private static Logger logger = LoggerFactory.getLogger(DynamicClassLoader.class);

    public DynamicClassLoader(ClassLoader classLoader) {
        super(new URL[0], classLoader);
    }

    public Class<?> loadClass(String fullName, byte[] classData) {
        return this.defineClass(fullName, classData, 0 , classData.length);
    }
}
